<template>
  <div class="app-container">
     <div
      style="
        width: 100%;
        height: 5%;
        padding-left: 20px;
        padding-top: 20px;
        padding-bottom: 30px;
      "
    >
      <breadcrumb :naviItems.sync="naviItems"></breadcrumb>
    </div>
    <el-table
      :data="tableData"
      style="width: 100%"
    >
      <el-table-column
        prop="integratedName"
        label="集成数据库（集）"
        align="center"
      />
      <el-table-column label="时间点" align="center">
        <el-table-column
          prop="itResults[0].testCount"
          label="测试量"
          align="center"
          width="150"
        />
        <el-table-column
          prop="itResults[0].errorCount"
          label="报错数"
          align="center"
          width="150"
        />
        <el-table-column
          prop="itResults[0].rate"
          label="报错率"
          align="center"
          width="150"
        />
      </el-table-column>
      <el-table-column label="应力值" align="center">
        <el-table-column
          prop="itResults[1].testCount"
          label="测试量"
          align="center"
          width="150"
        />
        <el-table-column
          prop="itResults[1].errorCount"
          label="报错数"
          align="center"
          width="150"
        />
        <el-table-column
          prop="itResults[1].rate"
          label="报错率"
          align="center"
          width="150"
        />
      </el-table-column>
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" @pagination="getList" />
  </div>
</template>

<script>
import { page } from '@/api/integrate-result'
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
import Breadcrumb from "../../components/QipingBreadCrumb/BreadCrumb.vue";
import { mapGetters } from "vuex";
export default {
  name: 'IntegrateResult',
  components: {
    Pagination,
    Breadcrumb
  },
  computed: {
    naviItems() {
      return [
        { text: this.equTypeName },
        { text: "数据测试" },
        { text: "集成测试" },
        { text: "测试结果" },
      ];
    },
    ...mapGetters(["equTypeName"]),
  },
  data() {
    return {
      total: 0,
      tableData: [],
      listQuery: {
        current: 1,
        size: 20
      }
    }
  },
  created() {
    this.getList()
  },
  methods: {
    getList() {
      page(this.listQuery).then(res => {
        // console.log(res)
        this.tableData = res.data.records
        this.total = res.data.total
        console.log(this.total)
      })
    }
  }
}
</script>

<style>

</style>
